#include "StdAfx.h"
#include "TexMgr.h"


CTexMgr CTexMgr::__this;

CTexMgr::CTexMgr():
m_texBank(128 * 1024, 0),
m_palBank(16 * 1024, 0)
{
}

BOOL CTexMgr::allocTex(u32 *addr, u32 *bank, u32 size)
{
	*bank = 0;
	return m_texBank.alloc(size, addr);
}

BOOL CTexMgr::allocPal(u32 *addr, u32 *bank, u32 size)
{
	*bank = 0;
	return m_palBank.alloc(size, addr);
}

void CTexMgr::freeTex(u32 addr, u32 bank, u32 size)
{
	m_texBank.dealloc(addr, size);
}

void CTexMgr::freePal(u32 addr, u32 bank, u32 size)
{
	m_palBank.dealloc(addr, size);
}
